package com.szzg10.jsp.chapter10;

import java.io.IOException;
import java.util.Iterator;
import java.util.List;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;

public class SimpleTagTest5 extends SimpleTagSupport {

	private List<Movie> movieList;

	@Override
	public void doTag() throws JspException, IOException {
		Iterator<Movie> iterator = movieList.iterator();
		while(iterator.hasNext()) {
			Movie movie = iterator.next();
			getJspContext().setAttribute("movie", movie);
			getJspBody().invoke(null);
		}
	}
	
	//---getter and setter
	public List<Movie> getMovieList() {
		return movieList;
	}

	public void setMovieList(List<Movie> movieList) {
		this.movieList = movieList;
	}
	
}
